var path = require('path')
var _ = require('underscore')

module.exports = {
  entry: ['webpack/hot/dev-server', './example/index.js'],
  output: {
    path: __dirname + '/example'
  },
  resolve: {
    root: [
      path.resolve('./src/js/libs'),
      path.resolve('./src/vue')
    ],
    extensions: ['', '.js', '.less', '.css'],
    modulesDirectories: ['node_modules']
  },
  // how modules should be transformed
  module: {
    loaders: [
      {
        test: /\.vue$/, // a regex for matching all files that end in `.vue`
        loader: 'vue'   // loader to use for matched files
      },
      {
        test: /\.js$/,
        loader: 'babel',
        exclude: /(node_modules|bower_components)/
      }, {
        test: /\.html$/,
        loader: 'html'
      },
      // {test: /\.jade$/, loader: 'jade'},
      {
        test: /\.png$/,
        loader: 'url?limit=8192&mimetype=image/png'
      }, {
        test: /\.jpe?g$/,
        loader: 'url?limit=8192&mimetype=image/jpg'
      }, {
        test: /\.gif$/,
        loader: 'url?limit=8192&mimetype=image/gif'
      }, {
        test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
        loader: 'url?limit=8192&mimetype=image/svg+xml'
      }, {
        test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/,
        loader: 'url?limit=8192&mimetype=application/font-woff2'
      }, {
        test: /\.woff(\?v=\d+\.\d+\.\d+)?$/,
        loader: 'url?limit=8192&mimetype=application/font-woff'
      }, {
        test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
        loader: 'url?limit=8192&mimetype=application/octet-stream'
      }, {
        test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,
        loader: 'file'
      }
    ]
  },
  // configure babel-loader.
  babel: {
    presets: ['es2015'],
    plugins: ['transform-runtime']
  },
  devtool: 'cheap-source-map'
}
